#include<stdio.h>
#include<conio.h>
int Prime(int n);
int TwinPrime(int n);
int Prime (int n)
{
	int i,kt=1;
	for(i=2;i<n;i++)
	{
		if(n%i==0)
		{
			kt=0;
			break;
		}
	}
	if (kt) return 1;
	else return 0;
}
int TwinPrime(int n)
{
	if ((Prime(n)==1)&&(Prime(n+2)==1)&&(Prime(n-2)==1)&&(n>=2))
	return 1;
	else return 0;
}
main (){
	printf("%d\n",TwinPrime(2));
	printf("%d\n",TwinPrime(5));
	printf("%d\n",TwinPrime(7));
	printf("%d\n",TwinPrime(53));
	printf("%d\n",TwinPrime(9));
	getch();
}
